<?php
namespace app\index\model;
use think\Model;
class Authgroupaccess extends Model
{
	//添加信息
    public function addres($data){
        //区分该管理员是添加还是修改权限
        if(model('Authgroupaccess')->where('adminid',$data['adminid'])->find())
            $result = $this->where('adminid',$data['adminid'])->update($data);
        else
            $result =  $this ->save($data);
        if($result===false){
            return false;
        } else{
            return true;
        }
    }
    //删除管理员-管理组
    public function del($id){
        $res=$this->where('adminid',$id)->delete();
        if ($res)
            return true;
        else
            return false;
    }
}